refs: Use *at for writes, honor repo fsync flag
authorColin Walters <walters@verbum.org>
Thu, 9 Apr 2015 01:54:28 +0000 (21:54 -0400)
committerColin Walters <walters@verbum.org>
Mon, 13 Apr 2015 12:47:05 +0000 (08:47 -0400)
commit1892a6fe13d8692428646947ee08ff0a8a5f5b43
treebfc9d8134bb428e9aff1697709a6518838dd44c0
parentc648fada30a00adaebb70d557cc24a4d57944bd4
refs: Use *at for writes, honor repo fsync flag

I was looking at https://bugzilla.gnome.org/show_bug.cgi?id=738954
which wants us to ensure we chown() the refs.  As part of that,
I did a generic conversion to use `*at()` (which naturally gives
us more low level control so we can call `fchown` etc.

This patch also sneaks in a change to respect the repo's
`disable_fsync` flag - if fsync is not set, then we never
`fdatasync()` (unlike the `g_file_replace_contents()` default.  Also
unlike it, if fsync is enabled, we *always* sync even if the file
didn't exist.
libglnx
src/libostree/ostree-repo-refs.c